package com.greenline.push.dal.pushcenter.impl;

import java.util.Date;

import com.greenline.push.dal.base.BaseDAO;
import com.greenline.push.dal.pushcenter.TaskLogDAO;
import com.greenline.push.dal.pushcenter.dataobject.TaskLogDO;
import com.greenline.push.dal.query.TaskLogQuery;

public class TaskLogDAOImpl extends BaseDAO implements TaskLogDAO {

    @Override
    public Long addTaskLog(TaskLogDO taskLog) {
        return (Long) this.getSqlMapClientTemplate().insert("taskLog.insert", taskLog);
    }

    @Override
    public void updateTaskLog(TaskLogDO taskLog) {
        this.getSqlMapClientTemplate().update("taskLog.update", taskLog);
    }

    @Override
    public Date getTaskLogLastTime(String taskType) {
        return (Date) this.getSqlMapClientTemplate().queryForObject("taskLog.getTaskLogLastTime", taskType);
    }

    @Override
    public TaskLogQuery queryTaskLog(TaskLogQuery query) {
        return (TaskLogQuery) this.listByQuery("taskLog.list_by_query", query);
    }

}
